import pygame
import sys

pygame.init()
pygame.mixer.init()

size= width,height=1024,681
bg = pygame.image.load('background.png')
screen = pygame.display.set_mode(size)

pygame.mixer.music.load('bg_music.ogg')
pygame.mixer.music.set_volume(0.2)
pygame.mixer.music.play()

cat = pygame.mixer.Sound('cat.wav')
cat.set_volume(0.2)
dog=pygame.mixer.Sound('dog.wav')
cat.set_volume(0.2)

clock=pygame.time.Clock()
pause = False
while True:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.mixer.music.stop()
            sys.exit()

        if event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                cat.play()
            if event.button == 3:
                dog.play()
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_SPACE:
                pause = not pause
                if pause :
                    pygame.mixer.music.pause()
                else:
                    pygame.mixer.music.unpause()
                  
    screen.blit(bg,(0,0))
    pygame.display.flip()
    clock.tick(30)
